package com.ijunfu.spring.genBean._14_context_register;

import com.ijunfu.spring.genBean._14_context_register.config.AppConfig;
import com.ijunfu.spring.genBean._14_context_register.utils.JsonHelper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 *
 * @Title  : 
 * @Author : ijunfu <ijunfu@163.com>
 * @Date   : 2023/11/10 16:55
 * @Version: 1.0
 * @Motto  : 世界很大 世界很小
 *
 */
public class ContextRegisterMain {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        // 注册Bean
        context.register(JsonHelper.class);

        // 测试 - 获取Bean
        JsonHelper jsonHelper = context.getBean(JsonHelper.class);
        jsonHelper.print();
    }
}
